﻿
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Graphics.PackedVector;

namespace PrisonStep
{
    struct ParticleVertex
    {
        /// <summary>
        /// Stores which corner of the particle quad this vertex represents.
        /// </summary>
        public Short2 mCorner;

        /// <summary>
        ///  Stores the starting position of the particle.
        /// </summary>
        public Vector3 mPosition;

        public Vector3 mVelocity;

        /// <summary>
        /// Four random values, used to make each particle look slightly different.
        /// </summary>
        public Color mRandom;

        /// <summary>
        /// The time the particle was created (in seconds).
        /// </summary>
        public float mTime;

        public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration
        ( 
            new VertexElement(0, VertexElementFormat.Short2,
                                VertexElementUsage.Position, 0),
            new VertexElement(4, VertexElementFormat.Vector3,
                                VertexElementUsage.Position, 1),
            new VertexElement(16, VertexElementFormat.Vector3,
                                VertexElementUsage.Normal, 0),
            new VertexElement(28, VertexElementFormat.Color,
                                VertexElementUsage.Color, 0),
            new VertexElement(32, VertexElementFormat.Single,
                                  VertexElementUsage.TextureCoordinate, 0)
        );

        // Describe the size of this vertex structure
        public const int mByteSize = 36;
    }
}